<%-- 
    Document   : exam
    Created on : Feb 22, 2012, 11:33:46 AM
    Author     : PhucAn
--%>

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@include  file="../handler/exam-do-test-action.jsp" %>
<script type="text/javascript" src="../script/exam.js"></script>
<script type="text/javascript">
    setTime(${exam.time*60});
    start(); 
  
</script>

<div class="exam-info" >
    
    <table>
        <tr>
            <td>Exam: </td>
            <td><span class="exam-name">${exam.name}</span></td>
            <td>Time:</td>
            <td>${exam.time}</td>
        </tr>
        <tr>
            <td>Remained time:</td>
            <td><input type="text" id="time-value"/></td>
            <td></td>
            <td></td>
        </tr>
    </table>
</div>
        <form action="#" method="post" onsubmit="return confirm('Are you sure want to submit?');">
    <c:forEach var="q" items="${exam.questionSet}">
        <div class="question-box">
            <div class="question">${q.content}</div>
            <ul class="answer-list">
                <c:forEach var="ans" items="${q.answers}">
                    <li><input id="question-answer-${q.id}"  type="${q.singleChoice?'radio':'checkbox'}" name="question-answer-${q.id}" value="${ans.id}"/>${ans.content}</li>
                    </c:forEach>
            </ul>
        </div>
    </c:forEach>
    <input type="hidden" name="submit-result" value="submit"/>
    <input type="submit" value="Submit"/>
   
</form>
